<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="${ctx}/static/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
		<script src="${ctx}/static/jquery/jquery-migrate-1.1.1.min.js" type="text/javascript"></script>

		<link href="${ctx}/static/bootstrap/3.3.4/css_default/bootstrap.min.css" type="text/css" rel="stylesheet" />
		<script src="${ctx}/static/bootstrap/3.3.4/js/bootstrap.min.js"  type="text/javascript"></script>
		<link href="${ctx}/static/awesome/4.4/css/font-awesome.min.css" rel="stylesheet" />
		
		<!--datatable-->
		<link rel="stylesheet" href="${ctx}/static/dataTables/css/jquery.dataTables.min.css" />
		<script type="text/javascript" src="${ctx}/static/dataTables/jquery.dataTables.js"></script>
		
		<!--datePicker.js-->
		<script type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
		
		<!--juicer-->
		<script type="text/javascript" src="${ctx}/static/juicer/juicer-min.js"></script>
		
		<!-- bootstrapvalidator -->
		<link href="${ctx}/static/dist/css/bootstrapValidator.min.css" rel="stylesheet" />
		<script type="text/javascript" src="${ctx}/static/dist/js/bootstrapValidator.min.js"></script>
		
		<script type="text/javascript" src="company.js"></script>
		
		<link rel="stylesheet" href="${ctx}/common/css/style.css" />
		
	</head>
	<body class="companyBody">
		<div class="container-fluid">
			
			<!--查询条件-->
			<div class="row" style='padding: 30px 0 20px 15px;'>
				<div class='isAdminProvince' style='float:left;margin-right:10px;'>
					<label id='lblSelect'>
						<span>省份</span>
						<select id="selectPointOfInterest" class='provinceSelect' style='border-radius:5px;width:80px;'>
						  
						</select>
						<script type="text/template" id="provinceSelectTpl">
							  	-~each aaData as item+
							  		<option value="#-item.proviceId+">#-item.proviceName+</option>
							  	-~/each+
						  </script>
					</label>
				</div>
				<div class='isAdminCity' style='float:left;margin-right:10px;'>
					<label id='lblSelect'>
						<span>城市</span>
						<select id="selectPointOfInterest" class='citySelect' style='border-radius:5px;width:80px;'>
						  
						</select>
						<script type="text/template" id="citySelectTpl">
							  	-~each aaData as item+
							  		<option value="#-item.sysCityId+">#-item.cityName+</option>
							  	-~/each+
						  </script>
					</label>
				</div>
				
				<div style='float:left;margin-right:10px;'>
					<label id='lblSelect'>
						<span>状态</span>
						<select id="selectPointOfInterest" class='statusSelect' style='border-radius:5px;width:80px;'>
							<option value=''>全部</option>
							<option value='2'>已禁用</option>
							<option value='1'>已启用</option>
						</select>
					</label>
				</div>
				<div class='' style='float:left;margin-right:10px;'>
					<label>
						<input style='display:inline;width: 200px;height:23px;padding:0;' class='form-control searchcompanyname' type='text' maxlength='15' placeholder='公司名/营业执照/联系人/电话' />
					</label>
				</div>
				<div class="col-md-2">
					<shiro:hasPermission name="sys:organization:view">
					<button class="btn btn-search btn-info" style="padding: 0 10px;"><i class='fa fa-search'></i>查询</button>
					</shiro:hasPermission>
					<shiro:hasPermission name="sys:organization:add">
					<button class="btn btn-add btn-success" style="padding: 0 10px;"><i class='fa fa-plus'></i>添加</button>
					</shiro:hasPermission>
					<button onclick="window.location.reload()" class='btn btn-primary' style="padding:0 10px;"><i class='glyphicon glyphicon-repeat'></i>刷新</button>
				</div>
			</div>
			
			<!--表格-->
			<div class="row">
				<div class="col-md-12">
					<table id="table" class="table table-bordered">
						<thead>
							<tr>
								<th>省份</th>
								<th>所在城市</th>
								<th>公司名称</th>
								<th>公司营业执照注册号</th>
								<th>公司联系人</th>
								<th>联系电话</th>
								<th>营业起始时间</th>
								<th>营业结束时间</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
			
						</tbody>
					</table>
				</div>
			</div>
			
			
			<!--详情模态框-->
			<div class="modal fade" id="myModalDetail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content">
			      <div class="modal-header modalHeaderCss">
			        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
			        <h4 class="modal-title" id="myModalLabel">公司详情</h4>
			      </div>
			      <div class="modal-body">
			      	<div class="row">
			      		<div class="col-md-12 modalFadeCss">
			      			<div class="row">
			      				<div class="col-md-4">所在省份:</div>
			      				<div class="col-md-8 province"></div>
			      			</div>
			      			<div class='row'>
			      				<div class="col-md-4">所在城市:</div>
			      				<div class="col-md-8 city"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司名称:</div>
			      				<div class="col-md-8 company"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司类型:</div>
			      				<div class="col-md-8 detailcompanyType"></div>
			      			</div>
			      			<div class="row companyParentRow">
			      				<div class="col-md-4">上级机构:</div>
			      				<div class="col-md-8 companyParent"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司地址:</div>
			      				<div class="col-md-8 address"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司营业执照注册号:</div>
			      				<div class="col-md-8 companyLic"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司联系人:</div>
			      				<div class="col-md-8 contactName"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">联系电话:</div>
			      				<div class="col-md-8 contactTel"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司邮箱:</div>
			      				<div class="col-md-8 email"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">营业期限:</div>
			      				<div class="col-md-8 companyDur"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">公司备注:</div>
			      				<div class="col-md-8 beizhu"></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-4">状态:</div>
			      				<div class="col-md-8 status"></div>
			      			</div>
			      		</div>
			      	</div>
			      </div>
			      <div class="modal-footer modalFooterCss">
			        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			      </div>
			    </div>
			  </div>
			</div>
			
			
			
			<!--编辑模态框-->
			<div class="modal fade" id="myModalEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content modal-editCompany">
			      <div class="modal-header editCompanyCssHeader">
			        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
			        <h4 class="modal-title" id="myModalLabel">公司详情</h4>
			      </div>
			      <form id="editcompanyForm" class="form-horizontal">
			      <div class="modal-body editCompanyFadeCss">
			      	<div class="row">
			      		<div class="col-md-12">
			      			<div class="row">
			      				<div class="col-md-12">
				      				<div class="col-md-4 editCompanyFadeCss_NowPro">所在省份:</div>
				      				<div class="col-md-8 pro-col">
					      				<label id='lblSelect' class="lblSelectNo3">
					      					<select class="editCompanyProvinceSel">
					      						
					      					</select>
					      				</label>
				      					<script type="text/template" id="editCompanyProvinceSelTpl">							
								  			-~each aaData as item+
							  					<option value="#-item.proviceId+">#-item.proviceName+</option>
							  				-~/each+
							    		</script>
				      				</div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
				      			<div class="col-md-12">
				      				<div class="col-md-4 editCompanyFadeCss_NowCity">所在城市:</div>
				      				<div class="col-md-8">
				      					<label id='lblSelect' class="lblSelectNo4">
				      						<select class="editCompanyCitySel">
				      						
				      						</select>
				      					</label>
				      					<script type="text/template" id="editCompanyCitySelTpl">
											-~each aaData as item+
							  					<option value="#-item.sysCityId+">#-item.cityName+</option>
							  				-~/each+
										</script>
				      				</div>
				      			</div>
			      			</div>
			      			
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4'>公司类型:</div>
			      					<div class='col-md-8'>
			      						<!-- <input type='radio' name='orgtype' value='1'>出租车公司
			      						<input type='radio' name='orgtype' value='2'>专车公司
			      						<input type='radio' name='orgtype' value='0'>总公司 -->
			      						<label id='lblSelect' class="lblSelectNew1">
			      						<select class="editCompanyType">
			      							<option value='0'>总公司</option>
			      							<option value='1'>出租车公司</option>
			      							<option value='2'>专车公司</option>
			      						</select>
			      						</label>
			      					</div>
			      				</div>
			      			</div>
			      			<div class="row EditCompanyCompanySelRow" style='margin-top:10px'>
				      			<div class="col-md-12">
				      				<div class="col-md-4 editCompanyFadeCss_NowCity">上级机构:</div>
				      				<div class="col-md-8">
				      				<label id='lblSelect' class="lblSelectNewJg">
				      					<select class="EditCompanyCompanySel">
				      						
				      					</select>
				      				</label>
				      					<script type="text/template" id="EditCompanyCompanySelTpl">
										-~each list as item+
							  				<option value="#-item.organizationId+">#-item.organizationName+</option>
							  			-~/each+
									</script>
				      				</div>
				      			</div>	
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_companyName'>公司名称:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcompanytruename form-control" type="text" name="editcompanytruename" maxlength='20' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Dz'>公司地址:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editaddressInputAdd form-control" type="text" name="editaddressInputAdd" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Zch'>营业执照号:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcompanyLicInputAdd form-control" type="text" name="editcompanyLicInputAdd" maxlength='15' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Lxr'>公司联系人:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcontactNameInputAdd form-control" type="text" name="editcontactNameInputAdd" maxlength='12' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Lxtel'>联系电话:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcompanytel form-control" type="text" name="editcompanytel" maxlength='11' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Email'>公司邮箱:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcompanyemail form-control" type="text" name="editcompanyemail" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Comment'>公司备注:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="editcompanybeizhu form-control" type="text" name="" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 editCompanyFadeCss_Date'>营业期限:</div>
			      					<div class='col-md-8 editcompanyduring'>
			      					<input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;display:inline-block;' type="text" onfocus="WdatePicker({})" id="datemin" class="input-text Wdate form-control" style="width:120px;">
									-
									<input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;display:inline-block;' type="text" onfocus="WdatePicker({})" id="datemax" class="input-text Wdate form-control" style="width:120px;">
			      					</div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4'>是否可用:</div>
			      					<div class='col-md-8 editcompanyState'>
			      						<input type='radio' name='state' value='1' checked>启用
			      						<input type='radio' name='state' value='2'>禁用
			      					</div>
			      				</div>
			      			</div>
			      		</div>
			      		<!-- <div class="col-md-6">
			      			<div class="imgBox" style="margin-top: 30px;">
						        <img class="img-responsive" id="blah1" src="#" alt="显示您上传的图片" />
						    </div>  
						    <input type='file' id="imgInp1" />
			      		</div> -->
			      	</div>
			      </div>
			      <div class="modal-footer editCompanyCssFooter">
			      	<button class="btn btn-default save-edit-btn">保存修改</button>
			        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			      </div>
			      </form>
			    </div>
			  </div>
			</div>
			
			
			
			<!--添加公司模态框-->
			<div class="modal fade" id="myModalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content modal-addCompany">
			      <div class="modal-header addCompanyFadeHeader">
			        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
			        <h4 class="modal-title" id="myModalLabel">添加公司</h4>
			      </div>
			      <form id="addcompanyForm" class="form-horizontal">
			      <div class="modal-body addCompanyFadeCss">
			      	
			      	<div class="row">			      				
			      			<div>
			      			<div class="row">
				      			<div class="col-md-12">
				      				<div class="col-md-4 addCompanyFadeCss_NowPro">所在省份:</div>
				      				<div class="col-md-8 pro-col">
				      				<label id='lblSelect' class="lblSelectNo1">
				      					<select class="AddCompanyProvinceSel">
				      						
				      					</select>
				      				</label>
				      					<script type="text/template" id="AddCompanyProvinceSelTpl">
								  		-~each aaData as item+
							  				<option value="#-item.proviceId+">#-item.proviceName+</option>
							  			-~/each+
							    		</script>
				      				</div>
				      			</div>			      			
			      			</div>
			      			<div class="row" style='margin-top:10px'>
				      			<div class="col-md-12">
				      				<div class="col-md-4 addCompanyFadeCss_NowCity">所在城市:</div>
				      				<div class="col-md-8">
				      				<label id='lblSelect' class="lblSelectNo2">
				      					<select class="AddCompanyCitySel">
				      						
				      					</select>
				      				</label>
				      					<script type="text/template" id="AddCompanyCitySelTpl">
										-~each aaData as item+
							  				<option value="#-item.sysCityId+">#-item.cityName+</option>
							  			-~/each+
									</script>
				      				</div>
				      			</div>	
			      			</div>
			      			
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_companyType'>公司类型:</div>
			      					<div class='col-md-8 companytype'>
			      						<label id='lblSelect' class="lblSelectNew1">
			      						<!-- <input type='radio' name='orgtype' value='1' checked>出租车公司
			      						<input type='radio' name='orgtype' value='2'>专车公司 -->
			      						<select class="addCompanyType">
			      							<option value='0'>总公司</option>
			      							<option value='1' selected>出租车公司</option>
			      							<option value='2'>专车公司</option>
			      						</select>
			      						</label>
			      					</div>
			      				</div>
			      			</div>
			      			  
			      			<div class="row AddCompanyCompanySelRow" style='margin-top:10px'>
				      			<div class="col-md-12">
				      				<div class="col-md-4 addCompanyFadeCss_NowCity">上级机构:</div>
				      				<div class="col-md-8">
				      				<label id='lblSelect' class="lblSelectNewJg">
				      					<select class="AddCompanyCompanySel">
				      						
				      					</select>
				      				</label>
				      					<script type="text/template" id="AddCompanyCompanySelTpl">
										-~each list as item+
							  				<option value="#-item.organizationId+">#-item.organizationName+</option>
							  			-~/each+
									</script>
				      				</div>
				      			</div>	
			      			</div>
			      			
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_companyName'>公司名称:</div>
			      					<div class='col-md-8 '><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="companytruename form-control" type="text" name="companytruename" maxlength='20' /></div>
			      				</div>  
			      			</div>
			      			
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Dz'>公司地址:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="addressInputAdd form-control" type="text" name="addressInputAdd" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Zch'>营业执照号:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="companyLicInputAdd form-control" type="text" name="companyLicInputAdd" maxlength='15' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Lxr'>公司联系人:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="contactNameInputAdd form-control" type="text" name="contactNameInputAdd" maxlength='12' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Lxtel'>联系电话:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="companytel form-control" type="text" name="companytel" maxlength='11' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Email'>公司邮箱:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="companyemail form-control" type="text" name="companyemail" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row form-group" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Comment'>公司备注:</div>
			      					<div class='col-md-8'><input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;' class="companybeizhu form-control" type="text" name="companybeizhu" maxlength='25' /></div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4 addCompanyFadeCss_Date'>营业期限:</div>
			      					<div class='col-md-8 companyduring'>
			      					<input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;display:inline-block;' type="text" onfocus="WdatePicker({})" class="comdurstart" style="width:120px;">
									-
									<input style='border:none;outline:none;border:1px solid #666;border-radius: 5px;display:inline-block;' type="text" onfocus="WdatePicker({})" class="comdurend" style="width:120px;">
			      					</div>
			      				</div>
			      			</div>
			      			<div class="row" style='margin-top:10px'>
			      				<div class="col-md-12">
			      					<div class='col-md-4'>是否可用:</div>
			      					<div class='col-md-8 companyState'>
			      						<input type='radio' name='state' value='1' checked>启用
			      						<input type='radio' name='state' value='2'>禁用
			      					</div>
			      				</div>
			      			</div>

                        
			      		</div>
			      		<!-- <div class="col-md-6">
			      			<div class="imgBox" style="margin-top: 30px;">
						        <img class="img-responsive" id="blah1" src="#" alt="显示您上传的图片" />
						    </div>  
						    <input type='file' id="imgInp1" />
			      		</div> -->
			      	</div>
			      </div>
			      <div class="modal-footer addCompanyFadeFooter">
			      	<button class="btn btn-default btn-addcompany">添加</button>
			        <button class="btn btn-default" data-dismiss="modal">取消</button>
			      </div>
			      </form>
			    </div>
			  </div>
			</div>
			
			
			
		</div>
	</body>
</html>
<script>
	
	function companyTable(wholeprovinceId,wholecityId,wholestatusId,searchcompanyname) {
		table = $("#table").DataTable({
			language: {
				"sInfoFiltered": "(共 _MAX_ 页)"
			},
			"pagingType": "simple_numbers",//设置分页控件的模式
	        searching: false,//屏蔽datatales的查询框
	        aLengthMenu:[10],//设置一页展示10条记录
	        "bLengthChange": false,//屏蔽tables的一页展示多少条记录的下拉列表,
	        "processing": true, //打开数据加载时的等待效果
	        "serverSide": true,//打开后台分页
	        "ajax": {
	           "url": ctx+"/sys/v1/organization/list", 
	           "type": 'POST',
	           "dataSrc": "aaData",
	        	   "data": {
	        		   proviceId: wholeprovinceId,
	        		   cityId: wholecityId,
	        		   state: wholestatusId,
	        		   condition: searchcompanyname
	        	 } 
	        },
	        "columnDefs": [
				{
					width: '15%',
					targets: -1,
					data: 'organizationStatus',
					render: function(data) {
						if(data == 1) {
							return "<shiro:hasPermission name='sys:organization:info'><a class='btn btn-info btn-xs btn-detail m-r-10'><i class='fa fa-search-plus'></i>详情</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:edit'><a class='btn btn-success btn-xs btn-edit'><i class='fa fa-edit'></i>编辑</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:on-off'><a class='btn btn-primary btn-xs btn-forbid'><i class='fa fa-plus'></i>禁用</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:delete'><a class='btn btn-danger btn-xs btn-delete'><i class='fa fa-trash-o'></i>删除</a></shiro:hasPermission>";
//									"<a class='btn btn-warning btn-xs btn-addSonCompany'><i class='fa fa-plus'></i>添加下级机构</a>";
						}
						if(data == 2) {
							return "<shiro:hasPermission name='sys:organization:info'><a class='btn btn-info btn-xs btn-detail m-r-10'><i class='fa fa-search-plus'></i>详情</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:edit'><a class='btn btn-success btn-xs btn-edit'><i class='fa fa-edit'></i>编辑</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:on-off'><a class='btn btn-primary btn-xs btn-forbid'><i class='fa fa-plus'></i>启用</a></shiro:hasPermission>"+
									"<shiro:hasPermission name='sys:organization:delete'><a class='btn btn-danger btn-xs btn-delete'><i class='fa fa-trash-o'></i>删除</a></shiro:hasPermission>";
//									"<a class='btn btn-warning btn-xs btn-addSonCompany'><i class='fa fa-plus'></i>添加下级机构</a>";
						}
					}
//					defaultContent: "<a class='btn btn-info btn-xs btn-detail m-r-10'><i class='fa fa-search-plus'></i>详情</a>"+
//									"<a class='btn btn-success btn-xs btn-edit'><i class='fa fa-edit'></i>编辑</a>"+
//									"<a class='btn btn-primary btn-xs btn-forbid'><i class='fa fa-plus'></i>禁用</a>"+
//									"<a class='btn btn-danger btn-xs btn-delete'><i class='fa fa-trash-o'></i>删除</a>"
				},
				{targets: 0,data: 'proviceName'},
				{targets: 1,data: 'cityName'},
				{targets: 2,data: 'organizationName'},
				{targets: 3,data: 'businessLicence'},
				{targets: 4,data: 'contacts'},
				{targets: 5,data: 'contactsNumber'},
				{targets: 6,data: 'licenseStartDate',render: function(data) {
					if(data.length > 1) {
						return data.substring(0,10);
					}
					else {
						return data;
					}
				}},
				{targets: 7,data: 'licenseEndDate',render: function(data) {
					if(data.length > 1) {
						return data.substring(0,10);
					}
					else {
						return data;
					}
				}},
				{targets: 8,data: 'organizationStatus',render: function(data) {
					if(data == 1) {
						return "已启用";
					}
					if(data == 2) {
						return "已禁用";
					}
				}}
			]
		});
		return table;
	}
	
</script>